﻿/***
    Copyright 2012 Stijn Van Antwerpen

    This file is part of Qasparov.

    Qasparov is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Qasparov is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Qasparov. If not, see <http://www.gnu.org/licenses/>.

 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Com.Oxilly.Qsb.Core.SDK;
using Com.Oxilly.Qsb.Core.SDK.API;
using Q = Qbus.Communication.Protocol;

namespace Com.Oxilly.Qsb.Core.QBusConnector.Commands
{
    #region Non Generic Implementation
    class QbusModuleCommand : QsbCommand
    {
        public string ModuleName { get; set; }
        public string MethodName { get; set; }


        public override void Execute(QsbEngineApi api)
        {
            //TODO: Fix
            //var module = api.GetModule(ModuleName);
            //module.GetType().GetMethod(MethodName).Invoke(module, null);
        }
    }
    #endregion

    #region Generic Implmentation
    internal abstract class QbusModuleCommand<ModuleType> : QsbCommand where ModuleType : Q.Module
    {
        public string ModuleName { get; set; }

        public override void Execute(QsbEngineApi api)
        {
            //var module = api.GetModule(ModuleName) as ModuleType;
            //Executing(module);
        }

        protected abstract void Executing(ModuleType module);
    }
    #endregion

}
